package com.mySampleApplication.client.components.item;

import com.smartgwt.client.widgets.form.fields.SelectItem;

import java.util.LinkedHashMap;

public class SRadioItem {
    public static SelectItem getRadioItem(){
        SelectItem selectItem = new SelectItem();
        selectItem.setTitle("Options");
        selectItem.setType("radio"); // 设置类型为单选框

        LinkedHashMap<String, String> valueMap = new LinkedHashMap<>();
        valueMap.put("1", "Option 1");
        valueMap.put("2", "Option 2");
        valueMap.put("3", "Option 3");
        selectItem.setValueMap(valueMap); // 设置选项

        selectItem.setDefaultValue("1"); // 设置默认选项

        return selectItem;
    }
}
